<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>鼠标拖动绘制贝塞尔曲线</title>
    <style>
        #element1, #element2 {
            width: 50px;
            height: 50px;
            position: absolute;
            background-color: lightblue;
            border-radius: 10px;
            cursor: pointer;
        }
        #element1 { top: 50px; left: 100px; }
        #element2 { top: 200px; left: 300px; }
        svg { position: absolute; top: 0; left: 0; pointer-events: none; }
    </style>
</head>
<body>

<svg id="svgCanvas" width="800px" height="600px" >
    <path id="bezierPath" fill="none" stroke="black" stroke-width="2" d=""/>
</svg>




<script>
  let path = document.getElementById("bezierPath");
  path.setAttribute("d","M 150 10 Q 0 0 300 100")
</script>

</body>
</html>
